import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useChannelStore = defineStore('channel', ()=>{
  // 默认频道 id: 0 为推荐
const channelId = ref(0)
// 修改频道 id 的回调函数，传递给子组件，子组件调用后回传 id
const updateChannelId = (id: number) => {
  channelId.value = id
}
  return { channelId, updateChannelId }
})
